package javanlp;
/**
 * A very simple class to represent a span.
 * Over a sentence "The rat was chased by the cat", 
 * the span [2,4] represents "was chased by".
 * Can be used for NPs or relation phrases. */
public class Spans {
    int begin = -1;
    int end = -1;
    Spans() {   }
    Spans(int a, int b) {
        begin = a;
        end = b;
    }
    void setBegin(int a) {   begin = a;   }
    void setEnd(int b) {    end = b;   }
    int getBegin() {    return begin;   }
    int getEnd() {     return end;   }
    int getLength() {
        return end - begin + 1;
    }
}

